3.990 \(\int \sec (c+d x) (a+a \sin (c+d x))^3 (A+B \sin (c+d x)) \, dx\)

Optimal. Leaf size=81 \[ -\frac{a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac{3 a^3 (A+B) \sin (c+d x)}{d}-\frac{4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac{B (a \sin (c+d x)+a)^3}{3 d} \]

[Out]

(-4*a^3*(A + B)*Log[1 - Sin[c + d*x]])/d - (3*a^3*(A + B)*Sin[c + d*x])/d - (a^3*(A + B)*Sin[c + d*x]^2)/(2*d)
 - (B*(a + a*Sin[c + d*x])^3)/(3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0947624, antiderivative size = 81, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.069, Rules used = {2836, 77} \[ -\frac{a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac{3 a^3 (A+B) \sin (c+d x)}{d}-\frac{4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac{B (a \sin (c+d x)+a)^3}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + a*Sin[c + d*x])^3*(A + B*Sin[c + d*x]),x]

[Out]

(-4*a^3*(A + B)*Log[1 - Sin[c + d*x]])/d - (3*a^3*(A + B)*Sin[c + d*x])/d - (a^3*(A + B)*Sin[c + d*x]^2)/(2*d)
 - (B*(a + a*Sin[c + d*x])^3)/(3*d)

Rule 2836

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d*x)/b
)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2,
 0]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \sec (c+d x) (a+a \sin (c+d x))^3 (A+B \sin (c+d x)) \, dx &=\frac{a \operatorname{Subst}\left (\int \frac{(a+x)^2 \left (A+\frac{B x}{a}\right )}{a-x} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac{a \operatorname{Subst}\left (\int \left (-3 a (A+B)+\frac{4 a^2 (A+B)}{a-x}-(A+B) x-\frac{B (a+x)^2}{a}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=-\frac{4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac{3 a^3 (A+B) \sin (c+d x)}{d}-\frac{a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac{B (a+a \sin (c+d x))^3}{3 d}\\ \end{align*}

Mathematica [A]  time = 0.1262, size = 68, normalized size = 0.84 \[ -\frac{a^3 \left (3 (A+3 B) \sin ^2(c+d x)+6 (3 A+4 B) \sin (c+d x)+24 (A+B) \log (1-\sin (c+d x))+2 B \sin ^3(c+d x)\right )}{6 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + a*Sin[c + d*x])^3*(A + B*Sin[c + d*x]),x]

[Out]

-(a^3*(24*(A + B)*Log[1 - Sin[c + d*x]] + 6*(3*A + 4*B)*Sin[c + d*x] + 3*(A + 3*B)*Sin[c + d*x]^2 + 2*B*Sin[c
+ d*x]^3))/(6*d)

________________________________________________________________________________________

Maple [B]  time = 0.087, size = 161, normalized size = 2. \begin{align*} -{\frac{{a}^{3}A \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-4\,{\frac{{a}^{3}A\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{B{a}^{3} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3\,d}}-4\,{\frac{B{a}^{3}\sin \left ( dx+c \right ) }{d}}+4\,{\frac{B{a}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-3\,{\frac{{a}^{3}A\sin \left ( dx+c \right ) }{d}}+4\,{\frac{{a}^{3}A\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-{\frac{3\,B{a}^{3} \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-4\,{\frac{B{a}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x)

[Out]

-1/2/d*a^3*A*sin(d*x+c)^2-4/d*a^3*A*ln(cos(d*x+c))-1/3/d*B*a^3*sin(d*x+c)^3-4*a^3*B*sin(d*x+c)/d+4/d*B*a^3*ln(
sec(d*x+c)+tan(d*x+c))-3/d*a^3*A*sin(d*x+c)+4/d*a^3*A*ln(sec(d*x+c)+tan(d*x+c))-3/2/d*B*a^3*sin(d*x+c)^2-4/d*B
*a^3*ln(cos(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.03075, size = 99, normalized size = 1.22 \begin{align*} -\frac{2 \, B a^{3} \sin \left (d x + c\right )^{3} + 3 \,{\left (A + 3 \, B\right )} a^{3} \sin \left (d x + c\right )^{2} + 24 \,{\left (A + B\right )} a^{3} \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \,{\left (3 \, A + 4 \, B\right )} a^{3} \sin \left (d x + c\right )}{6 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/6*(2*B*a^3*sin(d*x + c)^3 + 3*(A + 3*B)*a^3*sin(d*x + c)^2 + 24*(A + B)*a^3*log(sin(d*x + c) - 1) + 6*(3*A
+ 4*B)*a^3*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.78676, size = 188, normalized size = 2.32 \begin{align*} \frac{3 \,{\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} - 24 \,{\left (A + B\right )} a^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (B a^{3} \cos \left (d x + c\right )^{2} -{\left (9 \, A + 13 \, B\right )} a^{3}\right )} \sin \left (d x + c\right )}{6 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(3*(A + 3*B)*a^3*cos(d*x + c)^2 - 24*(A + B)*a^3*log(-sin(d*x + c) + 1) + 2*(B*a^3*cos(d*x + c)^2 - (9*A +
 13*B)*a^3)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))**3*(A+B*sin(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.38332, size = 390, normalized size = 4.81 \begin{align*} \frac{2 \,{\left (6 \,{\left (A a^{3} + B a^{3}\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right ) - 12 \,{\left (A a^{3} + B a^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{11 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} + 11 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} + 9 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 12 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 36 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 42 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 18 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 28 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 36 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 42 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 9 \, A a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 12 \, B a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 11 \, A a^{3} + 11 \, B a^{3}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3}}\right )}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="giac")

[Out]

2/3*(6*(A*a^3 + B*a^3)*log(tan(1/2*d*x + 1/2*c)^2 + 1) - 12*(A*a^3 + B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1))
 - (11*A*a^3*tan(1/2*d*x + 1/2*c)^6 + 11*B*a^3*tan(1/2*d*x + 1/2*c)^6 + 9*A*a^3*tan(1/2*d*x + 1/2*c)^5 + 12*B*
a^3*tan(1/2*d*x + 1/2*c)^5 + 36*A*a^3*tan(1/2*d*x + 1/2*c)^4 + 42*B*a^3*tan(1/2*d*x + 1/2*c)^4 + 18*A*a^3*tan(
1/2*d*x + 1/2*c)^3 + 28*B*a^3*tan(1/2*d*x + 1/2*c)^3 + 36*A*a^3*tan(1/2*d*x + 1/2*c)^2 + 42*B*a^3*tan(1/2*d*x
+ 1/2*c)^2 + 9*A*a^3*tan(1/2*d*x + 1/2*c) + 12*B*a^3*tan(1/2*d*x + 1/2*c) + 11*A*a^3 + 11*B*a^3)/(tan(1/2*d*x
+ 1/2*c)^2 + 1)^3)/d